<!DOCTYPE html>
<html lang="zh">
<head>
    <th:block th:include="include :: header('文件上传')"/>
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">

                    <div class="form-group">
                        <label class="font-noraml">附件列表</label>
                        <div class="file-loading">
                            <input id="fileinput-demo-1" name="file" type="file" multiple>
                        </div>
                    </div>
                    <hr>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script type="text/javascript">
    $(document).ready(function () {
        var docId = '[[${docId}]]';
        var docType = '[[${docType}]]';
        var imgArr = [];

        $("#fileinput-demo-1").fileinput({
            'theme': 'explorer-fas',
            'uploadUrl': ctx + 'system/appendix/upload',
            overwriteInitial: false,
            initialPreviewAsData: true,
            uploadExtraData:{docId:docId,docType:docType},
            previewFileType:['image','xlsx', 'html', 'text', 'video', 'audio', 'flash', 'object','other'],
            initialPreview: [

            ]
        });
        $("#fileinput-demo-1").on("fileuploaded", function (event, data, previewId, index) {
            console.log(JSON.stringify(data))
            console.log(data.response.fileName)
        })
    });
</script>
</body>
</html>
